package com.jm.sms.zp;


import org.apache.zookeeper.AsyncCallback;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.ACL;

import java.io.IOException;
import java.util.List;

public class Zoop {

    public static void main(String[] args){

    }


    public  void connect(){

        try {
            final ZooKeeper zookeeper = new ZooKeeper("192.168.28.128:2181",5000,new Watcher(){

                public void process(WatchedEvent watchedEvent) {
                    System.out.println(watchedEvent.getState());

                }
            });
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
